import { createI18n } from 'vue-i18n'
import LangZHCN from './lang/zh'
import LangEN from './lang/en'
// console.log("当前系统语言", uni.getLocale())
const defaultLang = uni.getStorageSync('lang') || 'en'
// console.log("当前系统语言", defaultLang, typeof defaultLang)

const i18n = createI18n({
  locale: defaultLang || 'en',
  messages: {
    en: LangEN,
    zh: LangZHCN,
  },
  fallbackLocale: 'en', // 回退语言
  legacy: false,
})
export default i18n
